package com.linkage.lcims.base.dao.business.impl;

//import java.util.List;
import java.util.List;
import java.util.Map;

import com.linkage.lcims.base.dao.HibernateBaseDAOImpl;
import com.linkage.lcims.base.dao.business.interfaces.TollPolicyAttrDAO;
//import com.linkage.lcims.base.po.business.BdTollAttrPolicy;
import com.linkage.lcims.base.po.business.BdTollPolicyAttr;
import com.linkage.lcims.base.po.business.BdTollPolicyAttrPK;
import com.linkage.util.exception.DAOException;

public class TollPolicyAttrDAOImpl extends HibernateBaseDAOImpl implements TollPolicyAttrDAO {

	private static final String PO_CLASS = "com.linkage.lcims.base.po.business.BdTollPolicyAttr";
		
	public TollPolicyAttrDAOImpl() {
		super();
	}
	
	public BdTollPolicyAttr getTollPolicyAttr(BdTollPolicyAttr bdTollPolicyAttr)
			throws DAOException {
		// TODO Auto-generated method stub
		return (BdTollPolicyAttr)this.getByID(BdTollPolicyAttr.class, bdTollPolicyAttr.getComp_id());
	}

	public void saveTollPolicyAttr(BdTollPolicyAttr bdTollPolicyAttr)
			throws DAOException {
		// TODO Auto-generated method stub
		this.save(bdTollPolicyAttr);
	}

	public void updateTollPolicyAttr(BdTollPolicyAttr bdTollPolicyAttr)
			throws DAOException {
		// TODO Auto-generated method stub
		this.merge(bdTollPolicyAttr);
	}

	public void deleteTollPolicyAttr(BdTollPolicyAttr bdTollPolicyAttr)
			throws DAOException {
		// TODO Auto-generated method stub
		this.delete(bdTollPolicyAttr);
	}

	public void updateFields(BdTollPolicyAttrPK id, Map<String, Object> fieldValues) throws DAOException {
		// TODO Auto-generated method stub
		this.updateField(PO_CLASS, id, fieldValues);
	}

	@SuppressWarnings("unchecked")
	public List<BdTollPolicyAttr> getAll() throws DAOException {
		// TODO Auto-generated method stub
		return super.getAll(BdTollPolicyAttr.class);
	}

//	@SuppressWarnings("unchecked")
//	public List<BdTollPolicyAttr> getTollPolicyAttrList(BdTollAttrPolicy bdTollAttrPolicy)
//			throws DAOException {
//		// TODO Auto-generated method stub
//		String hql = "from BdTollPolicyAttr as policyAttr where policyAttr.comp_id.policyid="+bdTollAttrPolicy.getComp_id().getPolicyid()+" and policyAttr.comp_id.recordid="+bdTollAttrPolicy.getComp_id().getRecordid();
//		return this.query(hql);
//	}

}
